<template>
    <el-dialog title="选取报名表" :visible.sync="dialogVisible">
    
        <el-table :data="tableList" style="width: 100%" stripe >
      <el-table-column label="报名表名称" prop="name"></el-table-column>
      

      <el-table-column label="操作" >
        <template slot-scope="scope">
     
          <el-link @click="selectOne(scope.row)" type="primary">选择</el-link>


       
        </template>
      </el-table-column>
    </el-table>
      <span slot="footer" class="dialog-footer">
        <!-- <el-button @click="cancle">取 消</el-button>
        <el-button type="primary" @click="submit">确 定</el-button> -->
      </span>
    </el-dialog>
  </template>
  <script>
  import { gameTemplatePageList,gameSave } from '@/config/api'
  export default {
    data () {
      return {
        dialogVisible: false,
        tableList:[],
        id:""
      };
    },
    methods: {
      async show (id) {
        console.log(id)
        this.dialogVisible = true
        const result = await gameTemplatePageList({page:1,pageSize:100})
        this.tableList = result.data.result.list
        this.id = id
      },
      // 选择报名表
      async selectOne(e){
        console.log(e)
        const res = await gameSave({id:this.id,tepId:e.id})
        if(res.data.status==200){
            this.dialogVisible = false
        }
        
      }
    
   
    }
  };
  </script>
